<template>
  <div class="cs-page-container">
    <div class="cs-filter-result">
      <el-table
        v-loading="listLoading"
        :data="list"
        :height="'calc(100vh - 250px)'"
        border
        fit
        size="small"
        highlight-current-row
        element-loading-text="拼命加载中"
        element-loading-spinner="el-icon-loading"
      >
        <el-table-column align="center" label="用户ID" prop="userId">
          <template slot-scope="{ row }">
            <TooptipsCom :user-id="row.userId" />
          </template>
        </el-table-column>
        <el-table-column align="center" label="昵称" prop="nickName">
        </el-table-column>
        <el-table-column align="center" label="用户充值" prop="nickName">
          <template slot-scope="{ row }">
            <span>{{ row.rechargeNum / 100 }}</span>
          </template>
        </el-table-column>
        <el-table-column align="center" label="提现金额" prop="withdrawNum">
          <template slot-scope="{ row }">
            <span>{{ row.withdrawNum / 100 }}</span>
          </template>
        </el-table-column>
        <el-table-column align="center" label="亲密度" prop="intimacyValue">
          <template slot-scope="{ row }">
            <span>{{ row.intimacyValue / 10 }}</span>
          </template>
        </el-table-column>
      </el-table>
      <TablePagination
        :current-page="listQuery.pageNum"
        :limit="listQuery.pageSize"
        :total="total"
        :loading="listLoading"
        @handleSizeChange="handleSizeChange2"
        @handleCurrentChange="handleCurrentChange2"
      />
    </div>
  </div>
</template>

<script>
import TablePagination from '@/components/TablePagination';
import { getUserIntimacyDetail } from '@/api/anchor';
export default {
name: 'Intimacy',
  components: { TablePagination },
  props: {
    userId: {
      type: Number,
      default: null
    }
  },
  data() {
    return {
      listQuery: {
        pageNum: 1,
        pageSize: 100
      },
      daterangeValue: '',
      list: [],
      listLoading: false,
      total: 0
    }
  },
  created() {
    this.doSearch()
  },
  methods: {
    doSearch: function() {
      this.listQuery['userId'] = this.userId
      getUserIntimacyDetail(this.listQuery).then(resp => {
        this.list = resp.data.list
        this.listLoading = false
        this.total = resp.data.total
      }).catch((err) => {
        this.$message.error(err)
        console.log(err)
      })
    }
  }
}
</script>

<style scoped>

</style>
